package au.org.arcs.dss.client.tds.adapter;

import ucar.nc2.NetcdfFile;

import au.org.arcs.dss.provider.dataset.DataSet;
import au.org.arcs.dss.provider.ConfigManager;

/**
 *
 * @author ming
 */
public class TDSAdapter {
  public static NetcdfFile getNetcdfFile(DataSet dataSet) {
    NetcdfFile netcdfFile = null;

    try {
      netcdfFile = NetcdfFile.openInMemory(dataSet.getName(), dataSet.getData());
    } catch (Exception ex) {
      ConfigManager.logger.error(ConfigManager.key + ": Error creating NETCDF File.", ex);
    }
    
    return netcdfFile;
  }
}